//
//  ModuleResult.m
//  LinkMap
//
//  Created by aron on 2022/5/7.
//  Copyright © 2022 ND. All rights reserved.
//

#import "ModuleResult.h"
#import "SymbolUtils.h"

@interface ModuleResult ()
/// 模块下所有目标文件
@property (nonatomic, strong) NSMutableArray<ObjectResult *> *objects;
/// 大小
@property (nonatomic, assign) NSUInteger size;
@end

@implementation ModuleResult

- (instancetype)init
{
    self = [super init];
    if (self) {
        _size = 0;
        _objects = [NSMutableArray new];
    }
    return self;
}

- (void)addObj:(ObjectResult *)obj {
    [_objects addObject:obj];
    _size += obj.size;
}

- (void)sortObjects {
    _objects = [SymbolUtils sortSymbols:_objects].mutableCopy;
}

@end
